package com.ruoyi.listen.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.listen.mapper.ListenLeaderMapper;
import com.ruoyi.listen.domain.ListenLeader;
import com.ruoyi.listen.service.IListenLeaderService;

/**
 * 领导听课Service业务层处理
 * 
 * @author yepanpan
 * @date 2021-03-15
 */
@Service
public class ListenLeaderServiceImpl implements IListenLeaderService 
{
    @Autowired
    private ListenLeaderMapper listenLeaderMapper;

    /**
     * 查询领导听课
     * 
     * @param id 领导听课ID
     * @return 领导听课
     */
    @Override
    public ListenLeader selectListenLeaderById(Long id)
    {
        return listenLeaderMapper.selectListenLeaderById(id);
    }

    /**
     * 查询领导听课列表
     * 
     * @param listenLeader 领导听课
     * @return 领导听课
     */
    @Override
    public List<ListenLeader> selectListenLeaderList(ListenLeader listenLeader)
    {
        return listenLeaderMapper.selectListenLeaderList(listenLeader);
    }

    /**
     * 新增领导听课
     * 
     * @param listenLeader 领导听课
     * @return 结果
     */
    @Override
    public int insertListenLeader(ListenLeader listenLeader)
    {
        listenLeader.setCreateTime(DateUtils.getNowDate());
        listenLeader.setCreateBy(SecurityUtils.getUsername());
        return listenLeaderMapper.insertListenLeader(listenLeader);
    }

    /**
     * 修改领导听课
     * 
     * @param listenLeader 领导听课
     * @return 结果
     */
    @Override
    public int updateListenLeader(ListenLeader listenLeader)
    {
        listenLeader.setUpdateTime(DateUtils.getNowDate());
        listenLeader.setUpdateBy(SecurityUtils.getUsername());
        return listenLeaderMapper.updateListenLeader(listenLeader);
    }

    /**
     * 批量删除领导听课
     * 
     * @param ids 需要删除的领导听课ID
     * @return 结果
     */
    @Override
    public int deleteListenLeaderByIds(Long[] ids)
    {
        return listenLeaderMapper.deleteListenLeaderByIds(ids);
    }

    /**
     * 删除领导听课信息
     * 
     * @param id 领导听课ID
     * @return 结果
     */
    @Override
    public int deleteListenLeaderById(Long id)
    {
        return listenLeaderMapper.deleteListenLeaderById(id);
    }
}
